﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using DAL;
public partial class ApproalManager : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //Frame.Global.GlobalFunctions.SetGridView(gvShow, true);
    }
    //批文编号，唯一标识
    protected void gvShow_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
    {
        e.NewValues["ID"] = DateTime.Now.ToString("yyyyMMddHHmmssff");
    }
    protected void gvShow_RowCommand(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewRowCommandEventArgs e)
    {
        using (DataClassesDataContext lqDB = new DataClassesDataContext())
        {
            string id = e.KeyValue.ToString();
            Approal type = lqDB.Approal.FirstOrDefault(t => t.ID == id);
            lqDB.Approal.DeleteOnSubmit(type);
            lqDB.SubmitChanges();
            Frame.Global.GlobalFunctions.AlertToUrl("删除成功！", "ApproalManager.aspx");
        }
    }
}